//
//  CXDelegateTestView.swift
//  CXSwiftDemo
//
//  Created by 潮汐 on 2023/12/7.

//协议代理传值
import UIKit

//协议代理
public protocol testDelegate: AnyObject {//必须实现
    func changeString(userName: String)
}

class CXDelegateTestView: UIView {
    //声明代理属性
    public weak var delegate: testDelegate?
    //在这里调用代理
    func testFun(){
        self.delegate?.changeString(userName: "hahaha")
    }
}

